

<!DOCTYPE html>
<html lang="zh-CN" data-default-color-scheme=&#34;auto&#34;>



<head>
  <meta charset="UTF-8">
  <link rel="apple-touch-icon" sizes="76x76" href="/img/boshi.jpeg">
  <link rel="icon" type="image/png" href="/img/boshi.jpeg">
  <meta name="viewport"
        content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  
  <meta name="theme-color" content="#2f4154">
  <meta name="description" content="">
  <meta name="author" content="wangpf">
  <meta name="keywords" content="">
  <title>axios - wpf的博客</title>

  <link  rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.4.1/css/bootstrap.min.css" />


  <link  rel="stylesheet" href="https://cdn.staticfile.org/github-markdown-css/4.0.0/github-markdown.min.css" />
  <link  rel="stylesheet" href="/lib/hint/hint.min.css" />

  
    
    <link  rel="stylesheet" href="https://cdn.staticfile.org/highlight.js/10.0.0/styles/foundation.min.css" />
  

  


<!-- 主题依赖的图标库，不要自行修改 -->

<link rel="stylesheet" href="//at.alicdn.com/t/font_1749284_6peoq002giu.css">



<link rel="stylesheet" href="//at.alicdn.com/t/font_1736178_pjno9b9zyxs.css">


<link  rel="stylesheet" href="/css/main.css" />

<!-- 自定义样式保持在最底部 -->


  <script  src="/js/utils.js" ></script>
  <script  src="/js/color-schema.js" ></script>
<meta name="generator" content="Hexo 5.1.1"></head>


<body>
  <header style="height: 70vh;">
    <nav id="navbar" class="navbar fixed-top  navbar-expand-lg navbar-dark scrolling-navbar">
  <div class="container">
    <a class="navbar-brand"
       href="/">&nbsp;<strong>Wangpf's blog</strong>&nbsp;</a>

    <button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
            data-target="#navbarSupportedContent"
            aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <div class="animated-icon"><span></span><span></span><span></span></div>
    </button>

    <!-- Collapsible content -->
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav ml-auto text-center">
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/">
                <i class="iconfont icon-home-fill"></i>
                首页
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/archives/">
                <i class="iconfont icon-archive-fill"></i>
                归档
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/categories/">
                <i class="iconfont icon-category-fill"></i>
                分类
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/tags/">
                <i class="iconfont icon-tags-fill"></i>
                标签
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/about/">
                <i class="iconfont icon-user-fill"></i>
                关于
              </a>
            </li>
          
        
        
          <li class="nav-item" id="search-btn">
            <a class="nav-link" data-toggle="modal" data-target="#modalSearch">&nbsp;<i
                class="iconfont icon-search"></i>&nbsp;</a>
          </li>
        
        
          <li class="nav-item" id="color-toggle-btn">
            <a class="nav-link" href="javascript:">&nbsp;<i
                class="iconfont icon-dark" id="color-toggle-icon"></i>&nbsp;</a>
          </li>
        
      </ul>
    </div>
  </div>
</nav>

    <div class="banner intro-2" id="background" parallax=true
         style="background: url('/img/article.jpg') no-repeat center center;
           background-size: cover;">
      <div class="full-bg-img">
        <div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.3)">
          <div class="container page-header text-center fade-in-up">
            <span class="h2" id="subtitle">
              
            </span>

            
              
  <div class="mt-3 post-meta">
    <i class="iconfont icon-date-fill" aria-hidden="true"></i>
    <time datetime="2020-09-26 15:17" pubdate>
      2020年9月26日 下午
    </time>
  </div>


<div class="mt-1">
  
    
    <span class="post-meta mr-2">
      <i class="iconfont icon-chart"></i>
      1.1k 字
    </span>
  

  
    
    <span class="post-meta mr-2">
      <i class="iconfont icon-clock-fill"></i>
      
      
      14
       分钟
    </span>
  

  
  
</div>

            
          </div>

          
        </div>
      </div>
    </div>
  </header>

  <main>
    
      

<div class="container-fluid">
  <div class="row">
    <div class="d-none d-lg-block col-lg-2"></div>
    <div class="col-lg-8 nopadding-md">
      <div class="container nopadding-md" id="board-ctn">
        <div class="py-5" id="board">
          <article class="post-content mx-auto" id="post">
            <!-- SEO header -->
            <h1 style="display: none">axios</h1>
            
            <div class="markdown-body" id="post-body">
              <h1 id="axios-⭐"><a href="#axios-⭐" class="headerlink" title="axios ⭐"></a>axios ⭐</h1><blockquote>
<p>axios: ajax i/o system.</p>
</blockquote>
<ul>
<li><p><strong>功能特点</strong> ：</p>
<ul>
<li>在浏览器中发送 XMLHttpRequests 请求</li>
<li>在 node.js 中发送 http请求</li>
<li>支持 Promise API</li>
<li>拦截请求和响应</li>
<li>转换请求和响应数据</li>
</ul>
</li>
<li><p><strong>支持多种请求方式</strong></p>
<ul>
<li>axios(config)</li>
<li>axios.request(config)</li>
<li>axios.get(url[, config])</li>
<li>axios.delete(url[, config])</li>
<li>axios.head(url[, config])</li>
<li>axios.post(url[, data[, config]])</li>
<li>axios.put(url[, data[, config]])</li>
<li>axios.patch(url[, data[, config]])</li>
</ul>
</li>
</ul>
<h2 id="get-请求演示"><a href="#get-请求演示" class="headerlink" title="get 请求演示"></a>get 请求演示</h2><p><img src="https://img-blog.csdnimg.cn/20200926145610808.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3Bmenp6eno=,size_16,color_FFFFFF,t_70#pic_center" srcset="/img/loading.gif" alt="get 请求演示"></p>
<h2 id="发送并发请求"><a href="#发送并发请求" class="headerlink" title="发送并发请求"></a>发送并发请求</h2><ul>
<li>有时候, 我们可能需求同时发送两个请求<ul>
<li>使用<strong>axios.all,</strong> 可以放入多个请求的数组. res[0],res[1] 得出结果</li>
<li><strong>axios.all([]) 返回的结果是一个数组</strong>，使用 axios.spread 可将数组 [res1,res2] 展开为 res1, res2</li>
</ul>
</li>
</ul>
<p><img src="https://img-blog.csdnimg.cn/20200926145610347.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3Bmenp6eno=,size_16,color_FFFFFF,t_70#pic_center" srcset="/img/loading.gif" alt="发送并发请求"></p>
<p>如果不使用  axios.spread 那就 用 最简单的数组方法得出结果：  res[0],res[1]</p>
<h2 id="全局配置"><a href="#全局配置" class="headerlink" title="全局配置"></a>全局配置</h2><blockquote>
<p>在上面的示例中, 我们的BaseURL是固定的<br>事实上, 在开发中可能很多参数都是固定的.<br>这个时候我们可以进行一些抽取, 也可以利用axiox的全局配置</p>
</blockquote>
<div class="hljs"><pre><code class="hljs javascript">axios.defaults.baseURL = ‘<span class="hljs-number">123.207</span><span class="hljs-number">.32</span><span class="hljs-number">.32</span>:<span class="hljs-number">8000</span>’axios.defaults.headers.
post[‘Content-Type’] = ‘application/x-www-form-urlencoded’;</code></pre></div>



<p><img src="https://img-blog.csdnimg.cn/20200926145610330.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3Bmenp6eno=,size_16,color_FFFFFF,t_70#pic_center" srcset="/img/loading.gif" alt="全局配置"></p>
<h2 id="创建-axios-实例"><a href="#创建-axios-实例" class="headerlink" title="创建 axios 实例"></a>创建 axios 实例</h2><ul>
<li>为什么要创建axios的实例呢?<ul>
<li>当我们从axios模块中导入对象时, 使用的实例是默认的实例.</li>
<li>当给该实例设置一些默认配置时, 这些配置就被固定下来了.</li>
<li>但是后续开发中, 某些配置可能会不太一样.</li>
<li>比如某些请求需要使用特定的baseURL或者timeout或者content-Type等.</li>
<li>这个时候, 我们就可以创建新的实例, 并且传入属于该实例的配置信息.  </li>
</ul>
</li>
</ul>
<p><img src="https://img-blog.csdnimg.cn/20200926145610848.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3Bmenp6eno=,size_16,color_FFFFFF,t_70#pic_center" srcset="/img/loading.gif" alt="创建 axios 实例"></p>
<h2 id="axios-模块化封装-⭐"><a href="#axios-模块化封装-⭐" class="headerlink" title="axios 模块化封装  ⭐"></a>axios 模块化封装  ⭐</h2><blockquote>
<p>在实际开发过程中，需要对AJAX请求进行统一的封装，使其模块化，易于修改和操作。</p>
<p>所以，最好这样做，而不是直接在 组件内使用 axios 插件 ，那样后期修改整个 axios 时会及其麻烦</p>
</blockquote>
<div class="hljs"><pre><code class="hljs javascript"><span class="hljs-keyword">import</span> axios <span class="hljs-keyword">from</span> <span class="hljs-string">&quot;axios&quot;</span>;


<span class="hljs-keyword">export</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">request</span>(<span class="hljs-params">config</span>) </span>&#123;
  <span class="hljs-comment">//  1.配置基本信息   </span>
  <span class="hljs-keyword">const</span> instance = axios.create(&#123;
    baseURL: <span class="hljs-string">&#x27;http://152.136.185.210:8000/api/z8&#x27;</span>,
    timeout: <span class="hljs-number">5000</span>
  &#125;)
  <span class="hljs-comment">//  本身返回的就一个 Promise   不需要再次封装一个 Promise来使用</span>
  <span class="hljs-comment">// 3.发送真正的网络请求  ( 方式一)</span>
  <span class="hljs-keyword">return</span> instance(config)
&#125;

 
<span class="hljs-comment">//  使用 回调函数   ( 方式二)</span>

<span class="hljs-comment">// export function request(config, success, failure) &#123;</span>

<span class="hljs-comment">//   const instance = axios.create(&#123;</span>
<span class="hljs-comment">//     baseURL: &#x27;http://152.136.185.210:8000/api/z8&#x27;,</span>
<span class="hljs-comment">//     timeout: 5000</span>
<span class="hljs-comment">//   &#125;)</span>

<span class="hljs-comment">//   instance(config)</span>
<span class="hljs-comment">//     .then(res =&gt; &#123;</span>
<span class="hljs-comment">//       success(res)</span>
<span class="hljs-comment">//     &#125;)</span>
<span class="hljs-comment">//     .catch(err =&gt; &#123;</span>
<span class="hljs-comment">//       failure(err)</span>
<span class="hljs-comment">//     &#125;)</span>

<span class="hljs-comment">// &#125;</span>


<span class="hljs-comment">// 使用 Promise      ( 方式三 )</span>
<span class="hljs-comment">// export function request(config) &#123;</span>

<span class="hljs-comment">//   return new Promise((resolve, reject) =&gt; &#123;</span>
<span class="hljs-comment">//     const instance = axios.create(&#123;</span>
<span class="hljs-comment">//       baseURL: &#x27;http://152.136.185.210:8000/api/z8&#x27;,</span>
<span class="hljs-comment">//       timeout: 5000</span>
<span class="hljs-comment">//     &#125;)</span>

<span class="hljs-comment">//     instance(config)</span>
<span class="hljs-comment">//       .then(res =&gt; &#123;</span>
<span class="hljs-comment">//         resolve(res)</span>
<span class="hljs-comment">//       &#125;)</span>
<span class="hljs-comment">//       .catch(err =&gt; &#123;</span>
<span class="hljs-comment">//         reject(err)</span>
<span class="hljs-comment">//       &#125;)</span>
<span class="hljs-comment">//   &#125;)</span>
<span class="hljs-comment">// &#125;</span>
</code></pre></div>

<div class="hljs"><pre><code class="hljs javascript"><span class="hljs-comment">//  在组件内 传入对象 进行网络请求</span>

<span class="hljs-comment">// 方式一和方式三（promise） ，</span>
request(&#123;
    url:<span class="hljs-string">&#x27;/home/multidata&#x27;</span>
&#125;).then(<span class="hljs-function"><span class="hljs-params">res</span> =&gt;</span>&#123;
    <span class="hljs-built_in">console</span>.log(res)
&#125;).catch(<span class="hljs-function"><span class="hljs-params">err</span>=&gt;</span>&#123;
    <span class="hljs-built_in">console</span>.log(err)
&#125;)

<span class="hljs-comment">// 方式二 （使用的回调函数）:</span>
request(&#123;
    url:<span class="hljs-string">&#x27;/home/multidata&#x27;</span>
&#125;,<span class="hljs-function"><span class="hljs-params">res</span>=&gt;</span>&#123;
    <span class="hljs-built_in">console</span>.log(res) 
&#125;,<span class="hljs-function"><span class="hljs-params">err</span>=&gt;</span>&#123;
    <span class="hljs-built_in">console</span>.log(err) 
&#125;)</code></pre></div>





<h2 id="axios-拦截器"><a href="#axios-拦截器" class="headerlink" title="axios 拦截器"></a>axios 拦截器</h2><blockquote>
<p>axios提供了拦截器，用于我们在发送每次请求或者得到相应后，进行对应的处理。</p>
</blockquote>
<div class="hljs"><pre><code class="hljs javascript"><span class="hljs-keyword">import</span> axios <span class="hljs-keyword">from</span> <span class="hljs-string">&quot;axios&quot;</span>;


<span class="hljs-keyword">export</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">request</span>(<span class="hljs-params">config</span>) </span>&#123;
  <span class="hljs-comment">//  1.配置基本信息   （创建实例， 这样不是全局的）</span>
  <span class="hljs-keyword">const</span> instance = axios.create(&#123;
    baseURL: <span class="hljs-string">&#x27;http://152.136.185.210:8000/api/z8&#x27;</span>,
    timeout: <span class="hljs-number">5000</span>
  &#125;)
  <span class="hljs-comment">// 2.axios 拦截器</span>
  <span class="hljs-comment">// 2.1请求拦截的作用： </span>
  instance.interceptors.request.use(<span class="hljs-function"><span class="hljs-params">config</span> =&gt;</span> &#123;
    <span class="hljs-comment">//  这里可以拦截一些：</span>
    <span class="hljs-comment">// 1. 比如config中的一些信息不符合服务器的要求  </span>
    <span class="hljs-comment">// 2. 比如每次发送网络请求时，都希望在页面中显示一个请求的图标</span>
    <span class="hljs-comment">// 3. 某些网络请求（比如登录需要的（token），必须携带一些特殊的信息）</span>
    <span class="hljs-built_in">console</span>.log(config);
    <span class="hljs-comment">// 拦截后 要发出去  要不就收不到</span>
    <span class="hljs-keyword">return</span> config
  &#125;, <span class="hljs-function"><span class="hljs-params">err</span> =&gt;</span> &#123;
    <span class="hljs-built_in">console</span>.log(err);
  &#125;)

  <span class="hljs-comment">// 2.2 响应拦截 </span>
  instance.interceptors.response.use(<span class="hljs-function"><span class="hljs-params">res</span> =&gt;</span> &#123;
      <span class="hljs-comment">// 响应的成功拦截中，主要是对数据进行过滤。</span>
    <span class="hljs-keyword">return</span> res.data <span class="hljs-comment">// 真正有用的东西是 data中的数据</span>
  &#125;, <span class="hljs-function"><span class="hljs-params">err</span> =&gt;</span> &#123;
    <span class="hljs-comment">// 响应的失败拦截中，可以根据status判断报错的错误码，跳转到不同的错误提示页面。</span>
    <span class="hljs-built_in">console</span>.log(err);
  &#125;)

  <span class="hljs-comment">//  本身返回的就一个 Promise   不需要再次封装一个 Promise来使用</span>
  <span class="hljs-comment">// 3.发送真正的网络请求</span>
  <span class="hljs-keyword">return</span> instance(config)
&#125;</code></pre></div>




            </div>
            <hr>
            <div>
              <div class="post-metas mb-3">
                
                <div class="post-meta mr-3">
                  <i class="iconfont icon-category"></i>
                  
                  <a class="hover-with-bg" href="/categories/vue/">vue</a>
                  
                </div>
                
                
                <div class="post-meta">
                  <i class="iconfont icon-tags"></i>
                  
                  <a class="hover-with-bg" href="/tags/vue/">vue</a>
                  
                </div>
                
              </div>
              
              
              <div class="post-prevnext row">
                <article class="post-prev col-6">
                  
                  
                  <a href="/2020/11/19/26-%E4%B8%AA%E4%BA%BA%E7%90%86%E8%A7%A3%E7%9A%84CSS%E6%96%87%E6%A1%A3%E6%B5%81/">
                    <i class="iconfont icon-arrowleft"></i>
                    <span class="hidden-mobile">个人理解的CSS文档流</span>
                    <span class="visible-mobile">上一篇</span>
                  </a>
                  
                </article>
                <article class="post-next col-6">
                  
                  
                  <a href="/2020/09/26/24-Vuex%E8%AF%A6%E8%A7%A3/">
                    <span class="hidden-mobile">Vuex详解</span>
                    <span class="visible-mobile">下一篇</span>
                    <i class="iconfont icon-arrowright"></i>
                  </a>
                  
                </article>
              </div>
              
            </div>

            
            <!-- Comments -->
            <article class="comments" id="comments">
              
              
  <div id="vcomments"></div>
  <script type="text/javascript">
    function loadValine() {
      addScript('https://cdn.staticfile.org/valine/1.4.14/Valine.min.js', function () {
        new Valine({
          el: "#vcomments",
          app_id: "hjxsDRXYScicliqD8I8JqoTu-gzGzoHsz",
          app_key: "qUcAEReEqeEVp5wwXJ41uCCp",
          placeholder: "说点什么",
          path: window.location.pathname,
          avatar: "retro",
          meta: ["nick","mail","link"],
          pageSize: "10",
          lang: "zh-CN",
          highlight: true,
          recordIP: false,
          serverURLs: "",
        });
      });
    }
    waitElementVisible('vcomments', loadValine);
  </script>
  <noscript>Please enable JavaScript to view the <a target="_blank" href="https://valine.js.org" rel="nofollow noopener noopener">comments
      powered by Valine.</a></noscript>


            </article>
            
          </article>
        </div>
      </div>
    </div>
    
    <div class="d-none d-lg-block col-lg-2 toc-container" id="toc-ctn">
      <div id="toc">
  <p class="toc-header"><i class="iconfont icon-list"></i>&nbsp;目录</p>
  <div id="tocbot"></div>
</div>

    </div>
    
  </div>
</div>

<!-- Custom -->


    
  </main>

  
    <a id="scroll-top-button" href="#" role="button">
      <i class="iconfont icon-arrowup" aria-hidden="true"></i>
    </a>
  

  
    <div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
     aria-hidden="true">
  <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header text-center">
        <h4 class="modal-title w-100 font-weight-bold">搜索</h4>
        <button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body mx-3">
        <div class="md-form mb-5">
          <input type="text" id="local-search-input" class="form-control validate">
          <label data-error="x" data-success="v"
                 for="local-search-input">关键词</label>
        </div>
        <div class="list-group" id="local-search-result"></div>
      </div>
    </div>
  </div>
</div>
  

  

  

  <footer class="mt-5">
  <div class="text-center py-3">
    <div>
      <a href="https://hexo.io" target="_blank" rel="nofollow noopener"><span>Hexo</span></a>
      <i class="iconfont icon-love"></i>
      <a href="https://github.com/fluid-dev/hexo-theme-fluid" target="_blank" rel="nofollow noopener">
        <span>Fluid</span></a>
    </div>
    
  <div class="statistics">
    
    

    
      
        <!-- 不蒜子统计PV -->
        <span id="busuanzi_container_site_pv" style="display: none">
            总访问量 
            <span id="busuanzi_value_site_pv"></span>
             次
          </span>
      
      
        <!-- 不蒜子统计UV -->
        <span id="busuanzi_container_site_uv" style="display: none">
            总访客数 
            <span id="busuanzi_value_site_uv"></span>
             人
          </span>
      
    
  </div>


    

    
  </div>
</footer>

<!-- SCRIPTS -->
<script  src="https://cdn.staticfile.org/jquery/3.4.1/jquery.min.js" ></script>
<script  src="https://cdn.staticfile.org/twitter-bootstrap/4.4.1/js/bootstrap.min.js" ></script>
<script  src="/js/debouncer.js" ></script>
<script  src="/js/main.js" ></script>

<!-- Plugins -->


  
    
      <script  src="/js/lazyload.js" ></script>
    
  



  <script defer src="https://cdn.staticfile.org/clipboard.js/2.0.6/clipboard.min.js" ></script>
  <script  src="/js/clipboard-use.js" ></script>



  <script defer src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js" ></script>





  <script  src="https://cdn.staticfile.org/tocbot/4.11.1/tocbot.min.js" ></script>
  <script>
    $(document).ready(function () {
      var boardCtn = $('#board-ctn');
      var boardTop = boardCtn.offset().top;

      tocbot.init({
        tocSelector: '#tocbot',
        contentSelector: '#post-body',
        headingSelector: 'h1,h2,h3,h4,h5,h6',
        linkClass: 'tocbot-link',
        activeLinkClass: 'tocbot-active-link',
        listClass: 'tocbot-list',
        isCollapsedClass: 'tocbot-is-collapsed',
        collapsibleClass: 'tocbot-is-collapsible',
        collapseDepth: 0,
        scrollSmooth: true,
        headingsOffset: -boardTop
      });
      if ($('.toc-list-item').length > 0) {
        $('#toc').css('visibility', 'visible');
      }
    });
  </script>



  <script  src="https://cdn.staticfile.org/typed.js/2.0.11/typed.min.js" ></script>
  <script>
    var typed = new Typed('#subtitle', {
      strings: [
        '  ',
        "axios&nbsp;",
      ],
      cursorChar: "_",
      typeSpeed: 70,
      loop: false,
    });
    typed.stop();
    $(document).ready(function () {
      $(".typed-cursor").addClass("h2");
      typed.start();
    });
  </script>



  <script  src="https://cdn.staticfile.org/anchor-js/4.2.2/anchor.min.js" ></script>
  <script>
    anchors.options = {
      placement: "right",
      visible: "always",
      
    };
    var el = "h1,h2,h3,h4,h5,h6".split(",");
    var res = [];
    for (item of el) {
      res.push(".markdown-body > " + item)
    }
    anchors.add(res.join(", "))
  </script>



  <script  src="/js/local-search.js" ></script>
  <script>
    var path = "/local-search.xml";
    var inputArea = document.querySelector("#local-search-input");
    inputArea.onclick = function () {
      searchFunc(path, 'local-search-input', 'local-search-result');
      this.onclick = null
    }
  </script>



  <script  src="https://cdn.staticfile.org/fancybox/3.5.7/jquery.fancybox.min.js" ></script>
  <link  rel="stylesheet" href="https://cdn.staticfile.org/fancybox/3.5.7/jquery.fancybox.min.css" />

  <script>
    $('#post img:not(.no-zoom img, img[no-zoom]), img[zoom]').each(
      function () {
        var element = document.createElement('a');
        $(element).attr('data-fancybox', 'images');
        $(element).attr('href', $(this).attr('src'));
        $(this).wrap(element);
      }
    );
  </script>







  
  
    <script>
      !function (e, t, a) {
        function r() {
          for (var e = 0; e < s.length; e++) s[e].alpha <= 0 ? (t.body.removeChild(s[e].el), s.splice(e, 1)) : (s[e].y--, s[e].scale += .004, s[e].alpha -= .013, s[e].el.style.cssText = "left:" + s[e].x + "px;top:" + s[e].y + "px;opacity:" + s[e].alpha + ";transform:scale(" + s[e].scale + "," + s[e].scale + ") rotate(45deg);background:" + s[e].color + ";z-index:99999");
          requestAnimationFrame(r)
        }

        function n() {
          var t = "function" == typeof e.onclick && e.onclick;
          e.onclick = function (e) {
            t && t(), o(e)
          }
        }

        function o(e) {
          var a = t.createElement("div");
          a.className = "heart", s.push({
            el: a,
            x: e.clientX - 5,
            y: e.clientY - 5,
            scale: 1,
            alpha: 1,
            color: c()
          }), t.body.appendChild(a)
        }

        function i(e) {
          var a = t.createElement("style");
          a.type = "text/css";
          try {
            a.appendChild(t.createTextNode(e))
          } catch (t) {
            a.styleSheet.cssText = e
          }
          t.getElementsByTagName("head")[0].appendChild(a)
        }

        function c() {
          return "rgb(" + ~~(255 * Math.random()) + "," + ~~(255 * Math.random()) + "," + ~~(255 * Math.random()) + ")"
        }

        var s = [];
        e.requestAnimationFrame = e.requestAnimationFrame || e.webkitRequestAnimationFrame || e.mozRequestAnimationFrame || e.oRequestAnimationFrame || e.msRequestAnimationFrame || function (e) {
          setTimeout(e, 1e3 / 60)
        }, i(".heart{width: 10px;height: 10px;position: fixed;background: #f00;transform: rotate(45deg);-webkit-transform: rotate(45deg);-moz-transform: rotate(45deg);}.heart:after,.heart:before{content: '';width: inherit;height: inherit;background: inherit;border-radius: 50%;-webkit-border-radius: 50%;-moz-border-radius: 50%;position: fixed;}.heart:after{top: -5px;}.heart:before{left: -5px;}"), n(), r()
      }(window, document);
    </script>
  











  

  

  

  

  

  





</body>
</html>
